package miniproj.services.serialization;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * A XmlAdapter to convert Date in String
 * 
 * @author Baptiste Viale
 * 
 */
public class SerializedDate extends XmlAdapter<String, java.sql.Date> {
	@Override
	public String marshal(java.sql.Date arg0) throws Exception {
		return String.valueOf(arg0.getTime());
	}

	@Override
	public java.sql.Date unmarshal(String arg0) throws Exception {
		return new java.sql.Date(Long.parseLong(arg0));
	}

}
